using System;
using System.Collections;
using EnvDTE;

namespace NUnitGenAddIn.Core.Test
{
    /// <summary>
    /// Mock Code Elements
    /// </summary>
	public class MockCodeElements : CodeElements
	{
		private readonly ArrayList _internalList = new ArrayList();

        /// <summary>
        /// Initializes a new instance of the <see cref="MockCodeElements"/> class.
        /// </summary>
        /// <param name="list">The list.</param>
		public MockCodeElements(ArrayList list)
		{
			if (list != null)
				_internalList = list;
		}

		#region CodeElements Members

        /// <summary>
        /// Gets the count.
        /// </summary>
        /// <value>The count.</value>
		public int Count
		{
			get { return _internalList.Count; }
		}

        /// <summary>
        /// Creates the unique ID.
        /// </summary>
        /// <param name="Prefix">The prefix.</param>
        /// <param name="NewName">The new name.</param>
        /// <returns></returns>
		public bool CreateUniqueID(string Prefix, ref string NewName)
		{
			throw new Exception("The method or operation is not implemented.");
		}

        /// <summary>
        /// Gets the DTE.
        /// </summary>
        /// <value>The DTE.</value>
		public DTE DTE
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the enumerator.
        /// </summary>
        /// <returns></returns>
		public IEnumerator GetEnumerator()
		{
			return _internalList.GetEnumerator();
		}

        /// <summary>
        /// Items the specified index.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <returns></returns>
		public CodeElement Item(object index)
		{
			throw new Exception("The method or operation is not implemented.");
		}

        /// <summary>
        /// Gets or sets the parent.
        /// </summary>
        /// <value>The parent.</value>
        public object Parent { get; set; }

        /// <summary>
        /// Reserved1s the specified element.
        /// </summary>
        /// <param name="Element">The element.</param>
        public void Reserved1(object Element)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		#endregion
	}
}